// pages/tuan/command/commandDetail/commandDetail.js
const app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        vote: undefined,
        appraiseList: [
            {
              username: "太白子",
              img: "/images/banggou.jpg",
              is_merchant: 0,
              isOpen: false,
              change: false,
              praise: 0,
              appraise_content: "上期的大米可以再团一次吗🎺上期的大米可以再团一次吗🎺上期的大米可以再团一次吗🎺上期的大米可以再团一次吗",
              reply_list: [
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25"},
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" },
              ],
              time: "今天 15:07",
            },
            {
              username: "太白子",
              img: "/images/banggou.jpg",
              is_merchant: 1,
              isOpen: false,
              change: false,
              praise: 0,
              appraise_content: "我想要食用油🚬我想要食用油🚬我想要食用油🚬我想要食用油🚬我想要食用油🚬",
              reply_list: [
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, time: "05-25", praise: 0, },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, time: "05-25", praise: 0, },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" },
                { nickname: "太白金星", img: "/images/banggou.jpg", reply_content: "我也是这么觉得", changes: false, praise: 0, time: "05-25" }
              ],
              time: "今天 15:07",
            },
            
          ],

          vote1:{
            id:0,
            date:"2021-6-13",
            title:"日常必需品需求采纳，点赞超80下周就团购哦！",
            votes_all:100,//最多可投票数
            options:[
                {
                    id:0,
                    name:'金龙鱼东北大米5kg',
                    imageUrl:'https://z3.ax1x.com/2021/06/14/2786G6.jpg',
                    mount:34,
                    speed:'34%',
                    isCollect: false
                },
                {
                  id:1,
                  name:'金龙鱼东北大米5kg',
                  imageUrl:'https://z3.ax1x.com/2021/06/14/2786G6.jpg',
                  mount:50,
                  speed:'50%',
                  isCollect: false
              },
              {
                  id:2,
                  name:'金龙鱼东北大米5kg',
                  imageUrl:'https://z3.ax1x.com/2021/06/14/2786G6.jpg',
                  mount:60,
                  speed:'60%',
                  isCollect: false
              },
              {
                  id:3,
                  name:'金龙鱼东北大米5kg',
                  imageUrl:'https://z3.ax1x.com/2021/06/14/2786G6.jpg',
                  mount:60,
                  speed:'60%',
                  isCollect: false
              },
              
            ]
        },
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
      app.sendGetRequest('/community/helphelp/voteInfoById?i='+options.id, (res) => {
        console.log(res);
        this.setData({
          vote: res.data
        })
      }, (err) => {
        console.log(err.errMsg)
      })


    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    },
    

 
  
  /**
   * 生命周期函数--监听页面加载
   */
  // onLoad: function(options) {
  //   var _this = this;
  //   var tiyan = this.data.userpingfen;
  //   for (var i = 0; i < tiyan.length; i++) {
  //     tiyan[i].pingfenpic = pingxin.pingfen(parseFloat(tiyan[i].pingfen));    //使用函数
  //   }
  //   _this.setData({
  //     userpingfen: tiyan
  //   })
  // },
   
})